package vapor.aquila.client;

import com.google.gwt.core.client.*;
import com.google.gwt.event.dom.client.*;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.*;
import vapor.aquila.client.game.*;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Aquila implements EntryPoint
{
	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad()
	{
		//	hide the loading span, since we're done loading at this point
		RootPanel.get("loadingSpan").setVisible(false);
		
		IGameServiceAsync service = GWT.create(IGameService.class);
		service.getMessage(
				new AsyncCallback<String>() {
					
					@Override
					public void onSuccess(String result) {
						RootPanel.get().add(new HTMLPanel(result));
					}
					
					@Override
					public void onFailure(Throwable caught) {
						RootPanel.get().add(new HTMLPanel(caught.getLocalizedMessage()));
					}
				});
	}
}
